package com.goodsAdv.model;

import java.sql.Timestamp;
import java.util.List;

import com.goods.model.GoodsVO;

public class GoodsAdvService {
	
	private IGoodsAdvDAO dao; 
	
	public GoodsAdvService(){
		dao = new GoodsAdvDAO();
	}
	
	public GoodsAdvVO addAdv(Integer goodsAdvOrder,Integer goodsClassNo,
			String goodsImgPathAdv) {

		GoodsAdvVO goodsAdvVO = new GoodsAdvVO();    	
		goodsAdvVO.setGoodsAdvOrder(goodsAdvOrder);
		goodsAdvVO.setGoodsClassNo(goodsClassNo);
		goodsAdvVO.setGoodsImgPathAdv(goodsImgPathAdv);
		dao.insert(goodsAdvVO);

		return goodsAdvVO;
	}

	public GoodsAdvVO updateAdv(Integer goodsClassNo,
			 String goodsImgPathAdv,Integer goodsAdvOrder) {

		GoodsAdvVO goodsAdvVO = new GoodsAdvVO();      			
		goodsAdvVO.setGoodsAdvOrder(goodsAdvOrder);
		goodsAdvVO.setGoodsClassNo(goodsClassNo);
		goodsAdvVO.setGoodsImgPathAdv(goodsImgPathAdv);
		dao.update(goodsAdvVO);

		return goodsAdvVO;
	}

	
	
	public void deleteAdv(Integer goodsAdvOrder){
	}
	
	public GoodsAdvVO getOneAdv(Integer goodsAdvOrder) {
		return dao.findByPrimaryKey(goodsAdvOrder);
	}

	public List<GoodsAdvVO> getAll() {
		return dao.getAll();
	}
	
	
}
